package com.hongye.pay.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lins
 * @date 2021/10/21 14:48
 */
@Configuration
public class MyMqConfig {
    @Bean
    public Queue rebundQueue(){
        return new Queue(
                "rebund",
                true,
                false,
                false);
    }
    @Bean
    public Exchange rebundExchange(){
        return new DirectExchange("rebund-exchange",
                true,
                false);
    }
    @Bean
    public Binding rebundBinding(){
        return new Binding(
                "rebund",
                Binding.DestinationType.QUEUE,
                "rebund-exchange",
                "rebund",
                null
        );
    }
}
